import type { AppRouteModule } from '@/router/types';

import { getParentLayout, LAYOUT } from '@/router/constant';
import { t } from '@/hooks/web/useI18n';

const peis: AppRouteModule = {
  path: '/peis', //router路径
  name: 'Peis', //router name
  component: LAYOUT, //layout标识是顶层菜单
  redirect: '/peis/peismanage/record', //跳转路径
  meta: {
    orderNo: 2, //排序号，数字越靠前菜单考前
    icon: 'medical-icon:cardiology', //icon图标
    title: t('routes.oper.peis.peis'), //标题，从locales/lang/zh-CN中找
  },
  //子菜单
  children: [
    {
      path: 'peismanage',
      name: 'PeisManage',
      meta: {
        icon: 'medical-icon:administration',
        title: t('routes.oper.peis.peismanage'),
      },
      redirect: '/peis/peismanage/record', //跳转路径
      children: [
        {
          path: 'record',
          name: 'Record',
          meta: {
            title: t('routes.oper.peis.record'),
          },
          component: () => import('@/views/peis/record/index.vue'), //数据记录
        },
        {
          path: 'handinput',
          name: 'HandInput',
          meta: {
            title: t('routes.oper.peis.handinput'),
          },
          component: () => import('@/views/peis/hand-input/index.vue'), //手动录入
        },
        {
          path: 'syncdata',
          name: 'SyncData',
          meta: {
            title: t('routes.oper.peis.syncdata'),
          },
          component: () => import('@/views/peis/sync-data/index.vue'), //数据同步
        },
        {
          path: 'checkdata',
          name: 'CheckData',
          meta: {
            title: t('routes.oper.peis.checkdata'),
          },
          component: () => import('@/views/peis/check-data/index.vue'), //数据复核
        },
        {
          path: 'doctorcheck',
          name: 'DoctorCheck',
          meta: {
            title: t('routes.oper.peis.doctorcheck'),
          },
          component: () => import('@/views/peis/doctor-check/index.vue'), //医师确认
        },
        {
          path: 'dataset',
          name: 'DataSet',
          meta: {
            title: t('routes.oper.peis.dataset'),
          },
          component: () => import('@/views/peis/data-set/index.vue'), //数据维护
        },
      ],
    },
    {
      path: 'reportmanage',
      name: 'ReportManage',
      meta: {
        icon: 'tabler:report',
        title: t('routes.oper.peis.reportmanage'),
      },
      redirect: '/peis/peismanage/record', //跳转路径
      children: [
        {
          path: 'report',
          name: 'Report',
          meta: {
            title: t('routes.oper.peis.report'),
          },
          component: () => import('@/views/peis/report/index.vue'), //体检报告
        },
        {
          path: 'reportplan',
          name: 'ReportPlan',
          meta: {
            title: t('routes.oper.peis.handinput'),
          },
          component: () => import('@/views/peis/report-plan/index.vue'), //体检报告进度
        },
      ],
    },
  ],
};

export default peis;
